if (!Array.prototype.forEach) {
    Array.prototype.forEach = function (fn, arg) {
        let arr = this,
            len = arr.length,
            thisArg = arg ? arg : undefined,
            i;

        for (i = 0; i < len; i += 1) {
            if (arr.hasOwnProperty(i)) {
                fn.call(thisArg, arr[i], i, arr);
            }
        }

        return undefined;
    };
}
